import 'package:flutter_application_1/pages/home_page/home_binding.dart';
import 'package:flutter_application_1/pages/home_page/home_view.dart';
import 'package:flutter_application_1/pages/list_detail_page/list_detail_binding.dart';
import 'package:flutter_application_1/pages/list_detail_page/list_detail_view.dart';
import 'package:flutter_application_1/pages/list_page/list_binding.dart';
import 'package:flutter_application_1/pages/list_page/list_view.dart';
import 'package:flutter_application_1/pages/message_page/message_binding.dart';
import 'package:flutter_application_1/pages/message_page/message_view.dart';
import 'package:flutter_application_1/pages/my_page/my_binding.dart';
import 'package:flutter_application_1/pages/my_page/my_view.dart';
import 'package:flutter_application_1/pages/other_page/other_binding.dart';
import 'package:flutter_application_1/pages/other_page/other_view.dart';
import 'package:get/get.dart';

import 'app_routes.dart';

class AppPages {
  static _pageBuilder({
    required String name,
    required GetPageBuilder page,
    Bindings? binding,
    bool preventDuplicates = true,
  }) => GetPage(
    name: name,
    page: page,
    binding: binding,
    preventDuplicates: preventDuplicates,
    transition: Transition.cupertino,
    popGesture: true,
  );

  static final routes = <GetPage>[
    _pageBuilder(
      name: AppRoutes.home,
      page: () => HomePage(),
      binding: HomeBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.list,
      page: () => ListPage(),
      binding: ListBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.listDetail,
      page: () => ListDetailPage(),
      binding: ListDetailBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.my,
      page: () => MyPage(),
      binding: MyBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.other,
      page: () => OtherPage(),
      binding: OtherBinding(),
    ),
    _pageBuilder(
      name: AppRoutes.message,
      page: () => MessagePage(),
      binding: MessageBinding(),
    ),
  ];
}
